import {wrapperType, EnumControlType, ITabsFields, layouts, ITabPanel} from "@/pages/dv/constants/EnumCommon";

class EnumFieldsConfig {

  style(prefix: string = ''): ITabsFields[]{
    return [
      {
        formItemProps: {
          name: prefix + 'style.color',
          label: '文本颜色'
        },
        controlProps: {
          mode: 'normal'
        },
        propType: 'Color',
        controlType: EnumControlType.ColorPicker,
      },
      {
        formItemProps: {
          name: prefix + 'style.fontSize',
          label: '大小'
        },
        controlProps: {
          min: 10,
        },
        col: 12,
        propType: 'number',
        controlType: EnumControlType.InputNumber,
      },
      {
        formItemProps: {
          name: prefix + 'style.lineHeight',
          label: '行高'
        },
        col: 12,
        propType: 'number | string',
        controlType: EnumControlType.Input,
      },
      {
        formItemProps: {
          name: prefix + 'style.fontWeight',
          label: '文字粗细'
        },
        controlProps: {
          step: null,
          min: 300,
          max: 700,
          marks: {
            300: 300,
            400: 400,
            500: 500,
            600: 600,
            700: 700,
          }
        },
        layout: layouts.vertical,
        controlType: EnumControlType.Slider,
      },
      {
        formItemProps: {
          name: prefix + 'style.textAlign',
          label: '对齐方式'
        },
        layout: layouts.vertical,
        controlType: EnumControlType.RadioGroup,
        data: [
          {value: 'left', label: '左对齐'},
          {value: 'center', label: '居中'},
          {value: 'right', label: '右对齐'},
        ]
      },
      {
        type: wrapperType.divider,
      },
      {
        formItemProps: {
          name: prefix + 'style.backgroundColor',
          label: '背景颜色'
        },
        controlProps: {
          mode: 'normal'
        },
        propType: 'Color',
        controlType: EnumControlType.ColorPicker,
      },
      {
        formItemProps: {
          name: prefix + 'style.overflow',
          label: '内容溢出元素框时'
        },
        layout: layouts.vertical,
        controlType: EnumControlType.RadioGroup,
        data: [
          {value: 'hidden', label: 'hidden'},
          {value: 'visible', label: 'visible'},
          {value: 'scroll', label: 'scroll'},
          {value: 'auto', label: 'auto'},
        ]
      },
      {
        formItemProps: {
          name: prefix + 'style.textOverflow',
          label: '文本溢出包含元素时'
        },
        layout: layouts.vertical,
        controlType: EnumControlType.RadioGroup,
        data: [
          {value: 'ellipsis', label: 'ellipsis'},
          {value: 'clip', label: 'clip'},
        ]
      },
      {
        formItemProps: {
          name: prefix + 'style.whiteSpace',
          label: '如何处理元素内的空白'
        },
        layout: layouts.vertical,
        controlType: EnumControlType.RadioGroup,
        data: [
          {value: 'normal', label: '默认。空白会被浏览器忽略。'},
          {value: 'pre', label: '空白会被浏览器保留。其行为方式类似 HTML 中的 <pre> 标签。'},
          {value: 'nowrap', label: '文本不会换行，文本会在在同一行上继续，直到遇到 <br> 标签为止。'},
          {value: 'pre-wrap', label: '保留空白符序列，但是正常地进行换行。'},
          {value: 'pre-line', label: '合并空白符序列，但是保留换行符。'},
        ]
      },
      {
        formItemProps: {
          name: prefix + 'style.wordWrap',
          label: '允许长单词或 URL 地址换行到下一行'
        },
        layout: layouts.vertical,
        controlType: EnumControlType.RadioGroup,
        data: [
          {value: 'normal', label: '只在允许的断字点换行'},
          {value: 'break-word', label: '在长单词或 URL 地址内部进行换行。'},
        ]
      },
    ]
  }
}

export default new EnumFieldsConfig();
